package dao;

import model.ShopCar;
import utils.GenicaDao;

import java.util.List;

public interface ShopCarDao extends GenicaDao<ShopCar,Integer> {


    /**
     * 根据用户id查找购物车记录
     * @param userId
     * @return  List<ShopCar>
     */
    public List<ShopCar> findInfoByUserID(Integer userId);

    /**
     * 添加购物车记录
     * @param shopCar
     * @return boolean
     */
    public boolean addInfo(ShopCar shopCar);

    /**
     * 通过用户id和商品id查找唯一一条记录
     * @param userId
     * @param goodsId
     * @return  ShopCar
     */
    public ShopCar findByUG(Integer userId,Integer goodsId);

}
